package indi.kane.demandlist.controller;

import indi.kane.demandlist.entity.Developer;
import indi.kane.demandlist.service.impl.DeveloperService;
import indi.kane.demandlist.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: DeveloperController
 * @Author: kane
 * @Date: 2020-06-09 12:22 下午
 * @Description:
 */
@RestController
@RequestMapping("developer")
public class DeveloperController {
    @Autowired
    private DeveloperService developerService;

    @PostMapping("selectByDemand")
    public ResultVo selectByDemand(@RequestBody Integer demand){
        return developerService.selectByDemand(demand);
    }

    @PostMapping("selectByMember")
    public ResultVo selectByMember(@RequestBody Integer member){
        return developerService.selectByMember(member);
    }

    @PostMapping("insert")
    public ResultVo insert(@RequestBody Developer developer){
        return developerService.insert(developer);
    }

    @PostMapping("update")
    public ResultVo update(@RequestBody Developer developer){
        return  developerService.update(developer);
    }

    @PostMapping("deleteByDemand")
    public ResultVo deleteByDemand(@RequestBody Integer demand){
        return  developerService.deleteByDemand(demand);
    }
}